/**
 * @(#) TeamProfileFacade.as
 *
 * @date		2009. 02. 26.
 * @version		1.0
 * @author		Shin, Yunwoo
 * @description	module facade (구성원 인사기록조회)
 * 				mvc간 주고 받는 메세지를 정의하고,  command를 등록한다. 
 */
package com.skt.common_hr.teamprofile
{
	import com.skt.common_hr.common.puremvc.CommonFacade;
	import com.skt.common_hr.teamprofile.controller.StartupCommand;
	
	import flash.display.DisplayObject;
	
	public class TeamProfileFacade extends CommonFacade
	{
		public static const STARTUP:String 						= 'startup';
		public static const CLOSE_MODULE:String					= 'closeModule';
		
		
		public static const LOAD_ORGLIST_COMPLETE:String		= "loadOrglistComplete";
		public static const LOAD_ORGLIST_FAILED:String			= "loadOrglistFailed";
		public static const LOAD_MEMBERSEARCH_COMPLETE:String	= "loadMembersearchComplete";
		public static const LOAD_MEMBERSEARCH_FAILED:String		= "loadMembersearchFailed";
		public static const LOAD_NAMESEARCH_COMPLETE:String		= "loadNameSearchComplete";
		public static const LOAD_NAMESEARCH_FAILED:String		= "loadNameSearchFailed";
		public static const CHANGE_SELECTED_MEMBER:String		= "changeSelectedMember";
		
		public static const LOAD_PROFILE_DETAIL_COMPLETE:String	= "loadProfileDetailComplete";
		public static const LOAD_PROFILE_DETAIL_FAILED:String	= "loadProfileDetailFailed";
		public static const LOAD_PROFILE_COMPLETE:String		= "loadProfileComplete";
		public static const LOAD_PROFILE_FAILED:String			= "loadProfileFailed";
		
		
		public function TeamProfileFacade( key:String )
		{
			super(key);	
		}
        
        /**
         * Singleton ApplicationFacade Factory Method
         */
        public static function getInstance( key:String ) : TeamProfileFacade 
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ] = new TeamProfileFacade( key );
            return instanceMap[ key ] as TeamProfileFacade;
        }
       
        /**
         * Register Commands with the Controller 
         *     - parent 클래스의 생성자에서 자동으로 호출됨
         */
        override protected function initializeController( ) : void {
            super.initializeController();            
            registerCommand( STARTUP, StartupCommand);
        }
       
        /**
         * Module의 시작점으로 Certificate.mxml의 creationComplete 이벤트에서 호출한다.
         *     
         */
        public function startup(app:Object) :void 
        {
        	trace("send startup in Team Profile");
        	this.app = app as DisplayObject;
            sendNotification( STARTUP, app );
        }
		
	}
}